The invention pertains to the field of up/down counters, and, more specifically, relates to the field of up/down counters with flexible operation features such as programmable divider, anti-aliasing capability for servo applications and asynchronous read and write capabilities.
In many applications, it is useful to have an up/down counter where the modulo number or the highest count the counter will reach before resetting to zero (hereafter the "terminal count") is programmable. Such a counter is a divide-by-n divider where n is programmable. Such counters are useful in electromechanical systems where the phase or timing relationships between various electrical and/or mechanical events must be measured. It is useful in many such applications to be able to program the counter to count up to a certain terminal count and then reset to zero or to count down from this terminal count and then reset to the current terminal count. Further, it is useful to be able to change the terminal count asynchronously such that when the current terminal count is reached (or zero is reached), the new terminal count is substituted as the current terminal count and the size of the counter's "loop", i.e., the numbers between zero and the terminal count, is changed.
Further, in applications such as servo applications where a microprocessor or other slow circuitry is involved in the reading process to read the current count and convert the count to a phase difference or error signal, it is useful to be able to asynchronously read the current count. This means, it is useful to take a "snapshot" of the current count at the time of the second event whose phase difference or error from the first event is to be determined, and then to read the count as it existed at the time of the snapshot at some later time when the microprocessor is ready.
It is also useful to be able to change directions of counting on the fly, i.e., without interrupting the count. This provides greater flexibility in designing systems with up/down counting needs. Further, it is useful to be able to disable the comparison to the terminal count with a control signal so that the counter will count past the terminal count to the maximum count which can be represented with the number of bits in the counter and then allow the counter to reset to zero.
In some servo system applications, it is possible for the two events to get extremely far out of phase. In such systems, if an up/down counter is used which can roll over to zero or the maximum count upon reaching the limit of its terminal count loop, "aliasing" can occur. Aliasing occurs if two events being measured are so far out of phase or are separated so far in time that the maximum possible count of the counter is exceeded and some additional counting is done before the second event occurs. In such a situation, for example, the maximum count which can be counted before rollover might be 100, but the two events are separated in time by 110 counts. The counter would count to 10 before the second event occurred after the rollover. The control circuitry that read the count and generated an error signal therefrom would think the two events were only 10 counts out of phase instead of 110 counts out of phase. It is useful in such situations to have an input signal which can be asserted in situations where aliasing might occur to prevent the rollover. In such a counter, the maximum count or zero would be reached, and no rollover to zero or the maximum count would occur when the signal was asserted.
Thus, a need has arisen for an up/down counter with a programmable modulus and flexibility in its operating modes.